import { createApp } from 'vue'

import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import App from '@/App.vue'
//@ts-expect-error忽略当前文件ts类型的检测否则有红色提示(打包会失败)
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
const app = createApp(App)
import 'virtual:svg-icons-register'
// 引入路由
import router from './router'
// 注册全局组件
import globalComponent from '@/components'
// 引入pinia
import pinia from './store'
import './permission'

// 按钮权限
import { permissionButton } from '@/directive/permission'
permissionButton(app) // 调用并传参
// 暗黑主题
import 'element-plus/theme-chalk/dark/css-vars.css'
app.use(globalComponent)
app.use(router)
app.use(pinia)
app.use(ElementPlus, {
  locale: zhCn,
})

// 引用全局样式
import '@/styles/index.scss'
app.mount('#app')
